<?php
class Application_Form_Contacto extends Zend_Form
{
	public function init(){
		$this->addDecorator('FormElements')        	
			->addDecorator('Form')
			->setAttrib('id','contactForm')
			->setAttrib('action','/contactos/index')
			->setAttrib('method','post');
			
		$textName = new Zend_Form_Element_Text('nombre');
		$textName
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label',array('class'=>'label'))		
			->setAttribs(array('class'=>'input1'))
			->setLabel('Nombre:')
			->setRequired(true);
		
		$textEmail = new Zend_Form_Element_Text('email');
		$textEmail
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label',array('class'=>'label'))		
			->setAttribs(array('class'=>'input1'))
			->setLabel('Correo electrónico:')
            ->setRequired(true)
            ->addValidator('EmailAddress');
			
		$textMensaje = new Zend_Form_Element_Textarea('mensaje');
		$textMensaje
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label',array('class'=>'label'))		
			->setAttribs(array('class'=>'textfield1','rows'=>'5'))
			->setLabel('Mensaje:')
            ->setRequired(true);

		$buttonSubmit = new Zend_Form_Element_Submit('submit');
		$buttonSubmit
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','class'=>'clear','placement'=>'PREPEND'))
			->setAttribs(array('class'=>'button-medium'))
            ->setAttribs(array('style'=>'float:right; height: 30px; width: 100px;'))
			->setDescription('<div class="clear"></div>')
			->setLabel('Enviar');
		
		$this->addElements( array (
			$textName,
			$textEmail,
			$textMensaje,
			$buttonSubmit
		));
		
	}
		
}